package cn.cvs.service.impl;

import cn.cvs.mapper.storagerecord.StorageRecordMapper;
import cn.cvs.pojo.StorageRecord;
import cn.cvs.service.StorageRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 邓必宏
 * @title:
 * @Demo:
 * @DateTime: 2023/10/27
 */

@Transactional
@Service("stoageRecordService")
public class StorageRecordServiceImpl implements StorageRecordService {

    @Autowired
    StorageRecordMapper supplierMapper;

    @Override
    public int getCount(String goodsName, Integer supplierId, Integer payStatus) {
        return supplierMapper.getCount ( goodsName,supplierId,payStatus );
    }

    @Override
    public List<StorageRecord> getList(String goodsName, Integer supplierId, Integer payStatus, Integer pageNo, Integer pageSize) {
        return supplierMapper.getList ( goodsName,supplierId,payStatus,(pageNo-1)*pageSize ,pageSize);
    }

    @Override
    public int add(StorageRecord storageRecord) {
        return supplierMapper.add ( storageRecord );
    }

    @Override
    public int del(Integer id) {
        return supplierMapper.del(id);
    }

    @Override
    public int update(StorageRecord storageRecord) {
        return supplierMapper.update ( storageRecord );
    }

    @Override
    public StorageRecord getStorageRecordById(Integer id) {
        return supplierMapper.getStorageRecordById ( id );
    }
}
